package com.aspose.cells;

abstract class zaag extends zzl {
   protected zagu a;
   protected zagu b;
   protected zaar c;

   public abstract zaag l();

   protected abstract zagu l(zaay var1);

   public zagu m() {
      return this.a;
   }

   public void c(zagu var1) {
      this.a = var1;
   }

   public zagu n() {
      return this.b;
   }

   public void d(zagu var1) {
      this.b = var1;
   }

   public zaag o() {
      zaag var1 = this.l();
      var1.a = this.a;
      var1.b = this.b;
      return var1;
   }

   public boolean k() {
      return false;
   }

   public boolean g() {
      return true;
   }

   public void a(boolean var1) {
      if (this.c == null) {
         this.c = new zaar();
      }

      if (var1) {
         this.a.a(true);
         this.b.a(true);
      }

   }

   public zaar h() {
      return this.c;
   }

   public void a(zaar var1) {
      this.c = var1;
   }

   public zagu i() {
      zaag var1 = this.l();
      var1.a = this.a.i();
      var1.b = this.b.i();
      if (this.c != null) {
         var1.c = this.c.a();
      }

      return var1;
   }

   public void j() {
      if (this.c != null) {
         this.c.b();
      }

   }

   public void p() {
      this.c = null;
   }

   public int d() {
      int var1 = this.a.d();
      if (var1 == 96) {
         return var1;
      } else {
         int var2 = this.b.d();
         return var2 != 64 ? var2 : var1;
      }
   }

   public int a(zaay var1) {
      int var2 = this.a.a(var1);
      if (var2 == 96) {
         return var2;
      } else {
         int var3 = this.b.a(var1);
         return var3 != 64 ? var3 : var2;
      }
   }

   public void e() {
      this.a.e();
      this.b.e();
   }

   public boolean c(zaay var1) {
      return this.a.c(var1) ? true : this.b.c(var1);
   }

   public int b(zaay var1, int var2) {
      int var3 = this.a.b(var1, var2) | this.b.b(var1, var2);
      return var3 > 1 ? 2 : var3;
   }

   public int b(zaay var1, boolean var2) {
      return this.a.b(var1, var2) & this.b.b(var1, var2);
   }

   public boolean a(zaay var1, int var2, int var3, boolean var4) {
      boolean var5 = false;
      if (this.a.a(var1, var2, var3, false)) {
         var5 = true;
      }

      if (this.b.a(var1, var2, var3, false)) {
         var5 = true;
      }

      if (var5 && this.c != null) {
         this.c.a(var1, var2, var3, var4);
      }

      return var5;
   }

   public boolean c(zaay var1, boolean var2) {
      return this.a.c(var1, var2) ? true : this.b.c(var1, var2);
   }

   public void a(StringBuilder var1, zaay var2) {
      this.a.a(var1, var2);
      this.b(var1, var2);
      this.b.a(var1, var2);
   }

   public zagu d(zaay var1) {
      if (this.c != null) {
         if (this.c.a == null) {
            this.c.a = this.l(var1);
         }

         return this.c.a;
      } else {
         return this.l(var1);
      }
   }

   public boolean f(zaay var1) {
      return this.a.f(var1) && this.b.f(var1);
   }

   public boolean g(zaay var1) {
      return this.a.g(var1) && this.b.g(var1);
   }

   public boolean h(zaay var1) {
      return this.a.h(var1) && this.b.h(var1);
   }

   public zagu a(int[] var1, zaay var2, boolean var3) {
      int var4 = var1[0];
      int var5 = var1[1];
      boolean var6 = true;
      boolean var7 = true;
      zagu var8 = this.a.a(var1, var2, var3);
      int var11 = var1[0];
      int var12 = var1[1];
      var1[0] = var4;
      var1[1] = var5;
      zagu var9 = this.b.a(var1, var2, var3);
      if (var11 > var1[0]) {
         var1[0] = var11;
      }

      if (var12 > var1[1]) {
         var1[1] = var12;
      }

      if (var11 == 1 && var12 == 1) {
         return this;
      } else {
         zaag var10 = this.l();
         var10.a = var8;
         var10.b = var9;
         return var10;
      }
   }

   public zagu a(int[] var1, zaay var2) {
      int var3 = var1[0];
      boolean var4 = true;
      zagu var5 = this.a.a(var1, var2);
      int var8 = var1[0];
      var1[0] = var3;
      zagu var6 = this.b.a(var1, var2);
      if (var8 > var1[0]) {
         var1[0] = var8;
      }

      if (var8 == 1) {
         return this;
      } else {
         zaag var7 = this.l();
         var7.a = var5;
         var7.b = var6;
         return var7;
      }
   }

   public zagu b(int[] var1, zaay var2) {
      int var3 = var1[0];
      boolean var4 = true;
      zagu var5 = this.a.b(var1, var2);
      int var8 = var1[0];
      var1[0] = var3;
      zagu var6 = this.b.a(var1, var2);
      if (var8 > var1[0]) {
         var1[0] = var8;
      }

      if (var8 == 1) {
         return this;
      } else {
         zaag var7 = this.l();
         var7.a = var5;
         var7.b = var6;
         return var7;
      }
   }

   public zahn a(zaay var1, boolean var2) {
      zaar var3 = null;
      int var4 = var1.m;
      zahn var5;
      if (var1.k) {
         var3 = this.h();
         if (var3 != null) {
            if (var3.a != null) {
               return var3.a.a(var1, var2);
            }

            if (var3.b != null) {
               if (var3.b.B() != 0) {
                  var5 = var3.b.c(var1);
                  if (var5 != null) {
                     if (!var5.a()) {
                        var5 = var5.b(var1);
                     }

                     var5.a(var1);
                     return var5;
                  }
               } else {
                  var3 = null;
               }
            } else {
               var1.c();
            }
         } else if (this.g()) {
            var3 = new zaar();
            this.a(var3);
            var1.c();
         }
      }

      var5 = this.a(this.a, var1);
      zahn var6 = this.a(this.b, var1);
      Object var7 = null;
      if (var5.l()) {
         if (var6.l()) {
            if (var5.a(0, 0) == this.a && var6.a(0, 0) == this.b) {
               this.a(false);
               return new zaya(this);
            }

            zaag var8 = this.l();
            var8.a = var5.a(0, 0);
            var8.b = var6.a(0, 0);
            var8.a(false);
            return new zaya(var8);
         }

         var7 = new zawt(var6, new zlm(var1, this, var1.g, var1.h, var5.a(0, 0)), var1);
      } else if (var6.l()) {
         var7 = new zawt(var5, new zll(var1, this, var1.g, var1.h, var6.a(0, 0)), var1);
      } else {
         var7 = zayc.a(var5, var6, var1, new zln(var1, this, var1.g, var1.h));
      }

      if (var1.k && var3 != null) {
         var7 = var3.a((zahn)var7, var1);
         var1.a(var4);
      }

      return (zahn)var7;
   }

   private zahn a(zagu var1, zaay var2) {
      return (zahn)(!var2.i && var1.d() != 96 ? new zaya(var1) : var1.a(var2, false));
   }

   public boolean a(zagu var1) {
      if (var1.b() != 5) {
         return false;
      } else {
         zzl var2 = (zzl)var1;
         if (var2.a() != this.a()) {
            return false;
         } else {
            zaag var3 = (zaag)var1;
            return this.a.a(var3.a) && this.b.a(var3.b);
         }
      }
   }

   public zagu b(zagu var1) {
      if (this.a(var1)) {
         return this;
      } else {
         zagu var2 = this.a.b(var1);
         return var2 != null ? var2 : this.b.b(var1);
      }
   }
}
